export default {
    namespaced: true,
    state: {
        isShow: true,
        _token: "",
    },
    mutations: {
        setIsShow(state, arg) {
            state.isShow = arg;
        },
        // 设置token的值
        setToken(state, arg) {
            state._token = arg;
            // 存储到localStorage中
            localStorage.setItem("_token", arg);
        },
    },
    actions: {
        setIsShowAsync(context, arg) {
            setTimeout(() => {
                context.commit("setIsShow", arg);
            }, 500);
        },
    },
    getters: {
        getIsShow(state) {
            return state.isShow ? "显示" : "隐藏";
        },
    },
};

